// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import BaseUI from "../BaseUI";

const { ccclass, property } = cc._decorator;

@ccclass
export default class DialogUI extends BaseUI {

    @property(cc.Button)
    sureBtn: cc.Button = null;
    @property(cc.Button)
    cancelBtn: cc.Button = null;
    @property(cc.Label)
    describeTxt: cc.Label = null;

    sureFun: Function;
    cancelFun: Function;
    caller: any;


    sureClick() {
        this.sureFun?.apply(this.caller);
        this.closeUI();
    }

    cancelClick() {
        this.cancelFun?.apply(this.caller);
        this.closeUI();
    }

}
